package com.itheima.listerner;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.itheima.pojo.OrderSetting;

import java.util.ArrayList;
import java.util.List;

/**
 * 这个类是easyExcel中所需要定义的类,List集合是封装EXCEL中的所有数据
 * @author hql
 * @date 2019-12-05 12:32
 */
public class DemoDataListener extends AnalysisEventListener<OrderSetting> {
    //将表中的数据封装到集合中
    private List<OrderSetting> orderSettingList = new ArrayList<OrderSetting>();

    public List<OrderSetting> getOrderSettingList() {
        return orderSettingList;
    }

    public void setOrderSettingList(List<OrderSetting> orderSettingList) {
        this.orderSettingList = orderSettingList;
    }

    @Override
    public void invoke(OrderSetting orderSetting, AnalysisContext analysisContext) {
            System.out.println(orderSettingList);
        orderSettingList.add(orderSetting);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
